import request from '@/utils/request'

export default {

  /**
   * 获取司机基本信息列表
   * @param fleetId 车队列表
   * @returns {AxiosPromise}
   */
  findAllDriver(driverQueryParams) {
    return request({
      url: `/base/goods/pd-truck-driver/page`,
      method: 'get',
      params: {
        'page': driverQueryParams.page,
        'pageSize': driverQueryParams.pageSize,
        'fleetId': driverQueryParams.fleetId
      }
    })
  },
  /**
   * 获取司机驾驶证信息
   * @param id
   * @returns {AxiosPromise}
   */
  findOneDriverLicense(id) {
    return request({
      url: `/base/goods/pd-truck-driver/${id}/driverLicense`,
      method: 'get'
    })
  },
  /**
   * 司机添加
   * @param driverParams
   * @returns {*}
   */
  saveDriver(driverParams) {
    return request({
      url: `/base/goods/pd-truck-driver`,
      method: 'post',
      data: driverParams
    })
  },
  /**
   * 获取司机基本个人信息
   * @param id
   * @returns {AxiosPromise}
   */
  findOneDriver(id) {
    return request({
      url: `/base/goods/pd-truck-driver/${id}`,
      method: 'get'
    })

  },
  /**
   * 查询全部司机 信息
   * @returns {AxiosPromise}
   */
  findAll() {
    return request({
      url: `/base/goods/pd-truck-driver/findAll`,
      method: 'get'
    })
  }

}
